package com.tang.spi;

import java.util.ServiceLoader;

public class Main {
    public static void main(String[] args) {
//        IHelloService service = new HumanService();
//        System.out.println(service.sayHello());
        ServiceLoader<IHelloService> loader = ServiceLoader.load(IHelloService.class);
        loader.forEach(iHelloService -> System.out.println(iHelloService.sayHello()));
    }
}
